
import libuv.uv ;

import 
	std.algorithm,
	std.array,
	std.conv,
	std.stdio;

import
	tango.io.device.Array,
	tango.stdc.stringz,
	tango.io.Stdout ,
	
	tango.math.random.Random,
	tango.net.device.Berkeley,
	tango.net.InternetAddress,
	tango.net.InternetAddress,
	Int	= tango.text.convert.Integer ,
	tango.core.Array ,
	tango.io.device.Array ,
	tango.io.device.File ;
	
alias File	= tango.io.device.File.File ;


void main(){
	auto loop	= uv_default_loop;
	
	writefln("version = %s, %s", uv_version,  to!string(uv_version_string) );
	
	writefln("time = %s", uv_now(loop) );
	writefln("uv_hrtime = %s", uv_hrtime() );
	writefln("uv_get_free_memory = %s", uv_get_free_memory() );
	writefln("uv_get_total_memory = %s", uv_get_total_memory() );
	
	writefln("uv_thread_self = %s ", uv_thread_self );
	
	char[1024]  exepath;
	uint exepath_i ;
	auto _exepath_i = uv_exepath( exepath.ptr, &exepath_i );
	writefln("uv_exepath = %s %s ", exepath_i, _exepath_i );
	
	
	uv_cpu_info_t* cpu_info = null ;
	uv_int cpu_count ;
	uv_cpu_info( &cpu_info, &cpu_count );
	writefln("cpu_count = %s", cpu_count );
	for(int i = 0; i < cpu_count; i++ ) {
		writefln("cpu  = %s", i );
		writefln(" \t  model = %s", cpu_info[i].model );
		writefln(" \t  speed = %s", cpu_info[i].speed );
		writefln(" \t  cpu_times = %s", cpu_info[i].cpu_times );
	}
	uv_free_cpu_info(cpu_info, cpu_count);
	
	uv_interface_address_s* if_info ;
	uv_int if_count ;
	uv_interface_addresses(&if_info, &if_count);
	writefln("if_count = %s", if_count );
	for(int i = 0; i < if_count; i++ ) {
		writefln("if  = %s", i );
		writefln(" \t  name = %s", to!string(if_info[i].name) );
		writefln(" \t  is_internal = %s", if_info[i].is_internal );
		writefln(" \t  __address4 = %s", if_info[i].__address4 );
		writefln(" \t  __address6 = %s", if_info[i].__address6 );
	}
	uv_free_interface_addresses(if_info, if_count);
	
}